package 招聘.华为.p2;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] args) {
        String s = new Scanner(System.in).nextLine();
        String[] t = s.split("--|\\*|@| +");
        for (int i = 0; i < t.length; i++) {
            t[i] = trim(t[i], '-');
        }
        for (int i = t.length - 1; i >= 0; i--) {
            if (!t[i].equals(""))
                System.out.print(t[i] + " ");
        }
    }

    public static String trim(String args, char beTrim) {
        int st = 0;
        int len = args.length();
        char[] val = args.toCharArray();
        char sbeTrim = beTrim;
        while ((st < len) && (val[st] <= sbeTrim)) {
            st++;
        }
        while ((st < len) && (val[len - 1] <= sbeTrim)) {
            len--;
        }
        return ((st > 0) || (len < args.length())) ? args.substring(st, len) : args;
    }

    public static String replaceBlank(String str) {
        Pattern pt = Pattern.compile("^\\s*|\\s*$");
        Matcher mt = pt.matcher(str);
        str = mt.replaceAll("");
        return str;
    }
}
